
/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

package com.skynet.spms.webservice.impl;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.skynet.spms.webservice.RFIDPortTypeSOAP;
import com.skynet.spms.webservice.entity.FaultResponse;
import com.skynet.spms.webservice.entity.QueryTasklistByTAGInputParameters;
import com.skynet.spms.webservice.entity.TasklistReocrdsOutputParameters;
import com.skynet.spms.webservice.service.WsRFIDService;
import com.skynet.spms.webservice.service.WsTaskService;
import com.skynet.spms.webservice.service.WsUserService;

/**
 * This class was generated by Apache CXF 2.3.1
 * Sat May 07 16:03:30 CST 2011
 * Generated source version: 2.3.1
 * 
 */

@javax.jws.WebService(
                      serviceName = "ServiceRFID",
                      portName = "PortRFID",
//                      wsdlLocation = "http://spms.comac.org/PortRFID?wsdl",
                      endpointInterface = "com.skynet.spms.webservice.RFIDPortTypeSOAP")
@Component("wsRFIDPortService")                      
public class RFIDPortTypeSOAPImpl implements RFIDPortTypeSOAP {

    private static final Logger LOG = LoggerFactory.getLogger(RFIDPortTypeSOAPImpl.class.getName());

    @Autowired
    private WsTaskService taskService;
    
    @Autowired
    private WsUserService userService;
    
    @Autowired
    private WsRFIDService rfidService;

    @Autowired
    private WsRFIDService wsRFIDService;
    
    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getVirtualLocaltion(org.skynetsoft.rfidwsdl.VisualLocationInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.VisualLocationOutputParameters getVirtualLocaltion(com.skynet.spms.webservice.entity.VisualLocationInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getVirtualLocaltion");
        try {
            return rfidService.getVirtualLocaltion(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getVirtualLocaltion fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getLocationInfo(org.skynetsoft.rfidwsdl.QueryLocationParameters  request )*
     */
    public com.skynet.spms.webservice.entity.QueryLocationOutParameters getLocationInfo(com.skynet.spms.webservice.entity.QueryLocationParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getLocationInfo");
        try {
            return rfidService.getLocationInfo(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getLocationInfo fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#setTaskDetailsExe(org.skynetsoft.rfidwsdl.SetTaskDetailsExeInputParameters  request )*
     */
    public boolean setTaskDetailsExe(com.skynet.spms.webservice.entity.SetTaskDetailsExeInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation setTaskDetailsExe");
        try {
        	return taskService.setTaskDetailsExe(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("setTaskDetailsExe fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#check4DoorControl(org.skynetsoft.rfidwsdl.Check4DoorControlInputParameters  request )*
     */
    public boolean check4DoorControl(com.skynet.spms.webservice.entity.Check4DoorControlInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation check4DoorControl");
        System.out.println(request);
        try {
        	return wsRFIDService.check4DoorControl(request);
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
        //throw new FaultResponse("FaultResponse...");
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getAllUsers(org.skynetsoft.rfidwsdl.AllUsersInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.AllUsersOutParameters getAllUsers(com.skynet.spms.webservice.entity.AllUsersInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getAllUsers");
        try {
            return userService.getAllUsers(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getAllUsers fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getTaskDetails(org.skynetsoft.rfidwsdl.GetTaskDetailsInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.GetTaskDetailsOutputParameters getTaskDetails(com.skynet.spms.webservice.entity.GetTaskDetailsInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getTaskDetails");
        try {
            return taskService.getTaskDetails(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getTaskDetails fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getUserIDCard(org.skynetsoft.rfidwsdl.QueryUserInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.AllUsersOutParameters getUserIDCard(com.skynet.spms.webservice.entity.QueryUserInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getUserIDCard");
        try {
            return userService.getUserIDCard(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getUserIDCard fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getRFIDSerial(org.skynetsoft.rfidwsdl.GetRFIDSerialInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.GetRFIDSerialOutputParameters getRFIDSerial(com.skynet.spms.webservice.entity.GetRFIDSerialInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getRFIDSerial");
        try {
            return rfidService.getRFIDSerial(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getRFIDSerial fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getUserInfo(org.skynetsoft.rfidwsdl.UserInfoInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.UserInfoOutputParameters getUserInfo(com.skynet.spms.webservice.entity.UserInfoInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getUserInfo");
        try {
            return userService.getUserInfo(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getUserInfo fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#isUserEnable(org.skynetsoft.rfidwsdl.QueryUserInputParameters  request )*
     */
    public boolean isUserEnable(com.skynet.spms.webservice.entity.QueryUserInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation isUserEnable");
        try {
            return userService.isUserEnable(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("isUserEnable fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#setUserIDCard(org.skynetsoft.rfidwsdl.UserIDCardInputParameters  request )*
     */
    public boolean setUserIDCard(com.skynet.spms.webservice.entity.UserIDCardInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation setUserIDCard");
        try {
            return userService.setUserIDCard(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("setUserIDCard fail",ex);
            throw new RuntimeException(ex);
        }
    }

    /* (non-Javadoc)
     * @see cxf.RFIDPortTypeSOAP#getTasklist(org.skynetsoft.rfidwsdl.QueryTasklistInputParameters  request )*
     */
    public com.skynet.spms.webservice.entity.TasklistReocrdsOutputParameters getTasklist(com.skynet.spms.webservice.entity.QueryTasklistInputParameters request) throws FaultResponse    { 
        LOG.info("Executing operation getTasklist");
        try {
            return taskService.getTasklist(request);
        }catch(FaultResponse e){
        	throw e;
        }catch (Exception ex) {
            LOG.error("getTasklist fail",ex);
            throw new RuntimeException(ex);
        }
    }

	@Override
	public TasklistReocrdsOutputParameters getRFIDTagTask(
			QueryTasklistByTAGInputParameters request) throws FaultResponse {
		LOG.info("get task list record by rfid");
		try{
			return taskService.getTaskListByRFIDTag(request);
		}catch(FaultResponse e){
			throw e;
		}catch(Exception ex){
			LOG.error("getTasklist by rfid fail",ex);
            throw new RuntimeException(ex);
		}
		
	}


}
